import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//按需加载模块
const Index = resolve => require(['@/components/Index'], resolve)
const Books = resolve => require(['@/components/Books'], resolve)
const Idea = resolve => require(['@/components/Idea'], resolve)
const Me = resolve => require(['@/components/Me'], resolve)

export default new Router({
    routes: [{
        path: '/',
        name: 'index',
        component: Index
    }, {
        path: '/books',
        name: 'books',
        component: Books
    }, {
        path: '/idea',
        name: 'idea',
        component: Idea
    }, {
        path: '/me',
        name: 'Me',
        component: Me
    }]
})